This page last changed on Mar 11, 2009 by straha1.
You Should Read the Tutorial First

These pages will make more sense to you if you read the job submission tutorial first. It tells you how to:

You only need to read the sections that are relevant to you – don't bother with the parallel job submission stuff if you're not going to run parallel jobs.

Running SAS on HPC's cluster nodes is similar to running any other serial job. In order to run SAS on the cluster nodes, we will need an SAS script and a QSub script. Here is a sample script that plots homework scores versus test scores in one EPS file and test scores versus homework scores in another EPS file. I will put the script in the file plotgrades.sas:

data grades;
input homework test;
cards;
48 66
72 75
61 70
88 79
75 91
92 93
77 90
58 69
63 68
;
filename file1 'homework-test.eps';
goptions reset=global DEVICE=pslepsfc gsfmode=replace gsfname=file1 hsize=4 vsize=3;
proc gplot;
plot homework*test;
run;
filename file2 'test-homework.eps';
goptions reset=global DEVICE=pslepsfc gsfmode=replace gsfname=file2 hsize=4 vsize=3;
proc gplot2;
plot test*homework;
run;

In order to run this script on the cluster nodes, we will need a qsub script which I will call plotgrades.qsub:

#!/bin/bash
: The above line tells Linux to use the shell /bin/bash to execute
: this script.  That must be the first line in the script.

: You must have no lines beginning with # before these
: PBS lines other than the /bin/bash line:
#PBS -N 'plotgrades'
#PBS -o 'qsub.out'
#PBS -e 'qsub.err'
#PBS -W umask=007
#PBS -q low_priority
#PBS -l nodes=1:ppn=4,walltime=4:00:00
#PBS -m bea

: Change our current working directory to the directory from which you ran qsub:
cd $PBS_O_WORKDIR

: Tell SAS to execute our plotgrades.sas script and then exit:
/usr/cluster/sas/9.1.3/sas plotgrades.sas

To run that script, you must submit it to the scheduler as a job using the qsub command:

qsub plotgrades.qsub

That will print out something like:

8031.hpc.cl.rs.umbc.edu

Eventually your job will run – you can run qstat to determine if your job is queued, running or completed. See Monitoring and Controlling Jobs on HPC for more information on how to do that. Once your job completes, it should produce several files. If you list them using ls -l, you should see something like this:

-rw-rw---- 1 straha1 pi_sparling 5709 Dec 14 00:36 homework-test.eps
-rw-rw---- 1 straha1 pi_sparling 3390 Dec 14 00:36 plotgrades.log
-rw-rw---- 1 straha1 pi_sparling  575 Dec 14 00:35 plotgrades.qsub
-rw-rw---- 1 straha1 pi_sparling  575 Dec 14 00:35 plotgrades.sas
-rw-rw---- 1 straha1 pi_sparling    0 Dec 14 00:36 qsub.err
-rw-rw---- 1 straha1 pi_sparling    0 Dec 14 00:36 qsub.out
-rw-rw---- 1 straha1 pi_sparling 5705 Dec 14 00:36 test-homework.eps

The qsub.err and qsub.out files contain everything that your job printed to its error and output streams, respectively. The plotgrades.log file contains detailed information about what SAS did while running your plotgrades.sas program. The two EPS files homework-test.eps and test-homework.eps are scatter plots that your program created. They should look something like this:

except that they are EPS files rather than GIFs. You can download sample output files using these links:


test-homework.eps (image/x-eps)
homework-test.eps (image/x-eps)
test-homework.gif (image/gif)
Document generated by Confluence on Mar 31, 2011 15:37